package com.task.core.mapper;

import java.util.List;
import java.util.Map;

import com.task.core.vo.resp.DeviceDetailRespVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.task.common.core.domain.entity.SysDept;
import com.task.common.domain.info.KeyAndValue;
import com.task.core.domain.DeviceInfo;
import com.task.core.dto.request.DeviceRequestDTO;

/**
 * @author 迪迦.
 * @date 2024/11/4 17:30
 */
@Mapper
public interface DeviceMapper {

  List<DeviceInfo> getDeviceByPage(DeviceRequestDTO request);

  DeviceInfo getDeviceByCode(String deviceCode);

  List<KeyAndValue> getDeviceForOption(DeviceRequestDTO request);

  void addDevice(@Param("request") DeviceRequestDTO request,
      @Param("deviceNames") List<Map<String, String>> deviceNames);

  Integer modifyDevice(DeviceRequestDTO request);

  Integer deleteDevice(@Param("code") String code, @Param("userId") Long userId);

  Integer checkDevice(@Param("deviceCode") String deviceCode);

  DeviceInfo getDeviceByName(@Param("deviceName") String deviceName,
      @Param("deptCode") Long deptCode);

  List<String> checkDeviceCanAdd(@Param("deviceNames") List<String> deviceNames,
      @Param("deptCode") String deptCode);

  Integer checkDeviceNameCanAddByCode(@Param("deviceName") String deviceName,
      @Param("code") String code,
      @Param("deptCode") String deptCode);

  void addDeviceEngineRelation(@Param("deviceCode") String deviceCode, @Param("engineCodes") List<String> engineCodes);

  List<DeviceInfo> getDeviceListByGroupCodes(@Param("groupCodes") List<String> groupCodes);

  void deleteDeviceEngineRelation(@Param("deviceCode") String deviceCode);

  List<String> getCanUseEngineCodesByDeviceCode(@Param("deviceCode") String deviceCode);

  List<SysDept> getAllDept();

  List<KeyAndValue> getAllDeptAdmin();

  DeviceInfo getDeviceDetailByCode(DeviceRequestDTO deviceRequestDTO);
}
